<!-- HTML header for doxygen 1.8.10-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<title>NATS C Client with JetStream and Streaming support: Message</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;" >
   <div id="projectname">NATS C Client with JetStream and Streaming support
   &#160;<span id="projectnumber">3.3.0</span>
   </div>
   <div id="projectbrief">The nats.io C Client, Supported by Synadia Communications Inc.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__msg_group.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Message<div class="ingroups"><a class="el" href="group__func_group.html">Functions</a></div></div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga1a091d24f939d881bf04fba78b8995c2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga1a091d24f939d881bf04fba78b8995c2">natsMsgList_Destroy</a> (<a class="el" href="structnats_msg_list.html">natsMsgList</a> *list)</td></tr>
<tr class="memdesc:ga1a091d24f939d881bf04fba78b8995c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys this list of messages.  <a href="group__msg_group.html#ga1a091d24f939d881bf04fba78b8995c2">More...</a><br /></td></tr>
<tr class="separator:ga1a091d24f939d881bf04fba78b8995c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga098e4fec1c5a71c00a0d092fbd6d1a21"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga098e4fec1c5a71c00a0d092fbd6d1a21">natsMsg_Create</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> **newMsg, const char *subj, const char *reply, const char *data, int dataLen)</td></tr>
<tr class="memdesc:ga098e4fec1c5a71c00a0d092fbd6d1a21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object.  <a href="group__msg_group.html#ga098e4fec1c5a71c00a0d092fbd6d1a21">More...</a><br /></td></tr>
<tr class="separator:ga098e4fec1c5a71c00a0d092fbd6d1a21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad7cad38946648e3047aa0665a3dd230a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#gad7cad38946648e3047aa0665a3dd230a">natsMsg_GetSubject</a> (const <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg)</td></tr>
<tr class="memdesc:gad7cad38946648e3047aa0665a3dd230a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the subject set in this message.  <a href="group__msg_group.html#gad7cad38946648e3047aa0665a3dd230a">More...</a><br /></td></tr>
<tr class="separator:gad7cad38946648e3047aa0665a3dd230a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga880535362c91b3e405792aa66ff945b6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga880535362c91b3e405792aa66ff945b6">natsMsg_GetReply</a> (const <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg)</td></tr>
<tr class="memdesc:ga880535362c91b3e405792aa66ff945b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the reply set in this message.  <a href="group__msg_group.html#ga880535362c91b3e405792aa66ff945b6">More...</a><br /></td></tr>
<tr class="separator:ga880535362c91b3e405792aa66ff945b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga523364451fd92534e754054266196e59"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga523364451fd92534e754054266196e59">natsMsg_GetData</a> (const <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg)</td></tr>
<tr class="memdesc:ga523364451fd92534e754054266196e59"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the message payload.  <a href="group__msg_group.html#ga523364451fd92534e754054266196e59">More...</a><br /></td></tr>
<tr class="separator:ga523364451fd92534e754054266196e59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga25b69066ae50287e178aaf4f70f7d3de"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga25b69066ae50287e178aaf4f70f7d3de">natsMsg_GetDataLength</a> (const <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg)</td></tr>
<tr class="memdesc:ga25b69066ae50287e178aaf4f70f7d3de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the message length.  <a href="group__msg_group.html#ga25b69066ae50287e178aaf4f70f7d3de">More...</a><br /></td></tr>
<tr class="separator:ga25b69066ae50287e178aaf4f70f7d3de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf30b47d4217c9335919f05536e379af8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#gaf30b47d4217c9335919f05536e379af8">natsMsgHeader_Set</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg, const char *key, const char *value)</td></tr>
<tr class="memdesc:gaf30b47d4217c9335919f05536e379af8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the header entries associated with <code>key</code> to the single element <code>value</code>.  <a href="group__msg_group.html#gaf30b47d4217c9335919f05536e379af8">More...</a><br /></td></tr>
<tr class="separator:gaf30b47d4217c9335919f05536e379af8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2b641ec3b1745604d7de1102e472254b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga2b641ec3b1745604d7de1102e472254b">natsMsgHeader_Add</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg, const char *key, const char *value)</td></tr>
<tr class="memdesc:ga2b641ec3b1745604d7de1102e472254b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add <code>value</code> to the header associated with <code>key</code>.  <a href="group__msg_group.html#ga2b641ec3b1745604d7de1102e472254b">More...</a><br /></td></tr>
<tr class="separator:ga2b641ec3b1745604d7de1102e472254b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab3349f0b0ce721b340d5c0753c90ee18"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#gab3349f0b0ce721b340d5c0753c90ee18">natsMsgHeader_Get</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg, const char *key, const char **value)</td></tr>
<tr class="memdesc:gab3349f0b0ce721b340d5c0753c90ee18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the header entry associated with <code>key</code>.  <a href="group__msg_group.html#gab3349f0b0ce721b340d5c0753c90ee18">More...</a><br /></td></tr>
<tr class="separator:gab3349f0b0ce721b340d5c0753c90ee18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae1ce9c9d82d151a3ea9dc03da048f66f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#gae1ce9c9d82d151a3ea9dc03da048f66f">natsMsgHeader_Values</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg, const char *key, const char ***values, int *count)</td></tr>
<tr class="memdesc:gae1ce9c9d82d151a3ea9dc03da048f66f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get all header values associated with <code>key</code>.  <a href="group__msg_group.html#gae1ce9c9d82d151a3ea9dc03da048f66f">More...</a><br /></td></tr>
<tr class="separator:gae1ce9c9d82d151a3ea9dc03da048f66f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6ee8a007111ada293dd24ff0bab02491"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga6ee8a007111ada293dd24ff0bab02491">natsMsgHeader_Keys</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg, const char ***keys, int *count)</td></tr>
<tr class="memdesc:ga6ee8a007111ada293dd24ff0bab02491"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get all header keys.  <a href="group__msg_group.html#ga6ee8a007111ada293dd24ff0bab02491">More...</a><br /></td></tr>
<tr class="separator:ga6ee8a007111ada293dd24ff0bab02491"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac78ca02dc93d05cae837ced6386408f1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#gac78ca02dc93d05cae837ced6386408f1">natsMsgHeader_Delete</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg, const char *key)</td></tr>
<tr class="memdesc:gac78ca02dc93d05cae837ced6386408f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete the value(s) associated with <code>key</code>.  <a href="group__msg_group.html#gac78ca02dc93d05cae837ced6386408f1">More...</a><br /></td></tr>
<tr class="separator:gac78ca02dc93d05cae837ced6386408f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga43aa4a8e4b93725b4876ee2677e19c7b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga43aa4a8e4b93725b4876ee2677e19c7b">natsMsg_IsNoResponders</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg)</td></tr>
<tr class="memdesc:ga43aa4a8e4b93725b4876ee2677e19c7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates if this message is a "no responders" message from the server.  <a href="group__msg_group.html#ga43aa4a8e4b93725b4876ee2677e19c7b">More...</a><br /></td></tr>
<tr class="separator:ga43aa4a8e4b93725b4876ee2677e19c7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9e9590018284939f43f60964283f33ae"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msg_group.html#ga9e9590018284939f43f60964283f33ae">natsMsg_Destroy</a> (<a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *msg)</td></tr>
<tr class="memdesc:ga9e9590018284939f43f60964283f33ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys the message object.  <a href="group__msg_group.html#ga9e9590018284939f43f60964283f33ae">More...</a><br /></td></tr>
<tr class="separator:ga9e9590018284939f43f60964283f33ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p >NATS Message. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga1a091d24f939d881bf04fba78b8995c2" name="ga1a091d24f939d881bf04fba78b8995c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1a091d24f939d881bf04fba78b8995c2">&#9670;&nbsp;</a></span>natsMsgList_Destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void natsMsgList_Destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnats_msg_list.html">natsMsgList</a> *&#160;</td>
          <td class="paramname"><em>list</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >This function iterates through the list of all messages and call <a class="el" href="group__msg_group.html#ga9e9590018284939f43f60964283f33ae" title="Destroys the message object.">natsMsg_Destroy</a> for each valid (not set to <code>NULL</code>) message. It then frees the array that was allocated to hold pointers to those messages.</p>
<dl class="section note"><dt>Note</dt><dd>The <a class="el" href="structnats_msg_list.html" title="A list of NATS messages.">natsMsgList</a> object itself is not freed since it is expected that users will pass a pointer to a stack object. Should the user create its own object, it will be the user responsibility to free this object.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">list</td><td>the <a class="el" href="structnats_msg_list.html" title="A list of NATS messages.">natsMsgList</a> list of <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> objects to destroy. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga098e4fec1c5a71c00a0d092fbd6d1a21" name="ga098e4fec1c5a71c00a0d092fbd6d1a21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga098e4fec1c5a71c00a0d092fbd6d1a21">&#9670;&nbsp;</a></span>natsMsg_Create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsMsg_Create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> **&#160;</td>
          <td class="paramname"><em>newMsg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>subj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>reply</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dataLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Creates a <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. This is used by the subscription related calls and by <a class="el" href="group__conn_pub_group.html#ga74511acd87385931112c45c48c2a14ba" title="Publishes a message on a subject.">natsConnection_PublishMsg()</a>.</p>
<dl class="section note"><dt>Note</dt><dd>Messages need to be destroyed with <a class="el" href="group__msg_group.html#ga9e9590018284939f43f60964283f33ae" title="Destroys the message object.">natsMsg_Destroy()</a> when no longer needed.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#ga9e9590018284939f43f60964283f33ae" title="Destroys the message object.">natsMsg_Destroy()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">newMsg</td><td>the location where to store the pointer to the newly created <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
    <tr><td class="paramname">subj</td><td>the subject this message will be sent to. Cannot be <code>NULL</code>. </td></tr>
    <tr><td class="paramname">reply</td><td>the optional reply for this message. </td></tr>
    <tr><td class="paramname">data</td><td>the optional message payload. </td></tr>
    <tr><td class="paramname">dataLen</td><td>the size of the payload. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gad7cad38946648e3047aa0665a3dd230a" name="gad7cad38946648e3047aa0665a3dd230a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad7cad38946648e3047aa0665a3dd230a">&#9670;&nbsp;</a></span>natsMsg_GetSubject()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char * natsMsg_GetSubject </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Returns the subject set on that message.</p>
<dl class="section warning"><dt>Warning</dt><dd>The string belongs to the message and must not be freed. Copy it if needed. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga880535362c91b3e405792aa66ff945b6" name="ga880535362c91b3e405792aa66ff945b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga880535362c91b3e405792aa66ff945b6">&#9670;&nbsp;</a></span>natsMsg_GetReply()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char * natsMsg_GetReply </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Returns the reply, possibly <code>NULL</code>.</p>
<dl class="section warning"><dt>Warning</dt><dd>The string belongs to the message and must not be freed. Copy it if needed.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga523364451fd92534e754054266196e59" name="ga523364451fd92534e754054266196e59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga523364451fd92534e754054266196e59">&#9670;&nbsp;</a></span>natsMsg_GetData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char * natsMsg_GetData </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Returns the message payload, possibly <code>NULL</code>.</p>
<p >Note that although the data sent and received from the server is not <code>NULL</code> terminated, the NATS C Client does add a <code>NULL</code> byte to the received payload. If you expect the received data to be a "string", then this conveniently allows you to call <a class="el" href="group__msg_group.html#ga523364451fd92534e754054266196e59" title="Returns the message payload.">natsMsg_GetData()</a> without having to copy the returned data to a buffer to add the <code>NULL</code> byte at the end.</p>
<dl class="section warning"><dt>Warning</dt><dd>The string belongs to the message and must not be freed. Copy it if needed.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga25b69066ae50287e178aaf4f70f7d3de" name="ga25b69066ae50287e178aaf4f70f7d3de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga25b69066ae50287e178aaf4f70f7d3de">&#9670;&nbsp;</a></span>natsMsg_GetDataLength()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> int natsMsg_GetDataLength </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Returns the message's payload length, possibly 0.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaf30b47d4217c9335919f05536e379af8" name="gaf30b47d4217c9335919f05536e379af8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf30b47d4217c9335919f05536e379af8">&#9670;&nbsp;</a></span>natsMsgHeader_Set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsMsgHeader_Set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >It will replace any existing value associated with <code>key</code>.</p>
<dl class="section warning"><dt>Warning</dt><dd>Prior to v3.0.0, the <code>key</code> was stored in its canonical form, this is no longer the case. Header keys are now case sensitive.</dd>
<dd>
Headers are not thread-safe, that is, you must not set/add/get values or delete keys for the same message from different threads. The internal structure of <code>natsMsg</code> may possible be altered during this call.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
    <tr><td class="paramname">key</td><td>the key under which the <code>value</code> will be stored. It can't ne <code>NULL</code> or empty. </td></tr>
    <tr><td class="paramname">value</td><td>the string to store under the given <code>key</code>. The value can be <code>NULL</code> or empty string. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga2b641ec3b1745604d7de1102e472254b" name="ga2b641ec3b1745604d7de1102e472254b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b641ec3b1745604d7de1102e472254b">&#9670;&nbsp;</a></span>natsMsgHeader_Add()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsMsgHeader_Add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >It will append to any existing values associated with <code>key</code>.</p>
<dl class="section warning"><dt>Warning</dt><dd>Prior to v3.0.0, the <code>key</code> was stored in its canonical form, this is no longer the case. Header keys are now case sensitive.</dd>
<dd>
Headers are not thread-safe, that is, you must not set/add/get values or delete keys for the same message from different threads. The internal structure of <code>natsMsg</code> may possible be altered during this call.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
    <tr><td class="paramname">key</td><td>the key under which the <code>value</code> will be stored. It can't ne <code>NULL</code> or empty. </td></tr>
    <tr><td class="paramname">value</td><td>the string to add to the values associated with the given <code>key</code>. The value can be <code>NULL</code> or empty string. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gab3349f0b0ce721b340d5c0753c90ee18" name="gab3349f0b0ce721b340d5c0753c90ee18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab3349f0b0ce721b340d5c0753c90ee18">&#9670;&nbsp;</a></span>natsMsgHeader_Get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsMsgHeader_Get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >If more than one entry for the <code>key</code> is available, the first is returned. The returned value is owned by the library and MUST not be freed or altered.</p>
<dl class="section warning"><dt>Warning</dt><dd>Prior to v3.0.0, the <code>key</code> was stored in its canonical form, this is no longer the case. Header keys are now case sensitive.</dd>
<dd>
Headers are not thread-safe, that is, you must not set/add/get values or delete keys for the same message from different threads. The internal structure of <code>natsMsg</code> may possible be altered during this call.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
    <tr><td class="paramname">key</td><td>the key for which the value is requested. </td></tr>
    <tr><td class="paramname">value</td><td>the memory location where the library will store the pointer to the first value (if more than one is found) associated with the <code>key</code>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>NATS_NOT_FOUND if <code>key</code> is not present in the headers. </dd></dl>

</div>
</div>
<a id="gae1ce9c9d82d151a3ea9dc03da048f66f" name="gae1ce9c9d82d151a3ea9dc03da048f66f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae1ce9c9d82d151a3ea9dc03da048f66f">&#9670;&nbsp;</a></span>natsMsgHeader_Values()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsMsgHeader_Values </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char ***&#160;</td>
          <td class="paramname"><em>values</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The returned strings are own by the library and MUST not be freed or altered. However, the returned array <code>values</code> MUST be freed by the user.</p>
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* *values = NULL;</div>
<div class="line"><span class="keywordtype">int</span>         count   = 0;</div>
<div class="line"> </div>
<div class="line">s = <a class="code hl_function" href="group__msg_group.html#gae1ce9c9d82d151a3ea9dc03da048f66f">natsMsgHeader_Values</a>(msg, <span class="stringliteral">&quot;My-Key&quot;</span>, &amp;values, &amp;count);</div>
<div class="line"><span class="keywordflow">if</span> (s == <a class="code hl_enumvalue" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9cee6c417868ecaa69f99ff4f6576990">NATS_OK</a>)</div>
<div class="line">{</div>
<div class="line">     <span class="comment">// do something with the values</span></div>
<div class="line"> </div>
<div class="line">     <span class="comment">// then free the array of pointers.</span></div>
<div class="line">     free((<span class="keywordtype">void</span>*) values);</div>
<div class="line">}</div>
<div class="ttc" id="agroup__msg_group_html_gae1ce9c9d82d151a3ea9dc03da048f66f"><div class="ttname"><a href="group__msg_group.html#gae1ce9c9d82d151a3ea9dc03da048f66f">natsMsgHeader_Values</a></div><div class="ttdeci">NATS_EXTERN natsStatus natsMsgHeader_Values(natsMsg *msg, const char *key, const char ***values, int *count)</div><div class="ttdoc">Get all header values associated with key.</div></div>
<div class="ttc" id="astatus_8h_html_a36c934157b663b7b5fb5d6609c897c80a9cee6c417868ecaa69f99ff4f6576990"><div class="ttname"><a href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9cee6c417868ecaa69f99ff4f6576990">NATS_OK</a></div><div class="ttdeci">@ NATS_OK</div><div class="ttdoc">Success.</div><div class="ttdef"><b>Definition:</b> status.h:51</div></div>
</div><!-- fragment --><dl class="section warning"><dt>Warning</dt><dd>Prior to v3.0.0, the <code>key</code> was stored in its canonical form, this is no longer the case. Header keys are now case sensitive.</dd>
<dd>
Headers are not thread-safe, that is, you must not set/add/get values or delete keys for the same message from different threads. The internal structure of <code>natsMsg</code> may possible be altered during this call.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
    <tr><td class="paramname">key</td><td>the key for which the values are requested. </td></tr>
    <tr><td class="paramname">values</td><td>the memory location where the library will store the pointer to the array of values. </td></tr>
    <tr><td class="paramname">count</td><td>the memory location where the library will store the number of values returned. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>NATS_NOT_FOUND if <code>key</code> is not present in the headers. </dd></dl>

</div>
</div>
<a id="ga6ee8a007111ada293dd24ff0bab02491" name="ga6ee8a007111ada293dd24ff0bab02491"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6ee8a007111ada293dd24ff0bab02491">&#9670;&nbsp;</a></span>natsMsgHeader_Keys()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsMsgHeader_Keys </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char ***&#160;</td>
          <td class="paramname"><em>keys</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The returned strings are own by the library and MUST not be freed or altered. However, the returned array <code>keys</code> MUST be freed by the user.</p>
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* *keys = NULL;</div>
<div class="line"><span class="keywordtype">int</span>         count   = 0;</div>
<div class="line"> </div>
<div class="line">s = <a class="code hl_function" href="group__msg_group.html#ga6ee8a007111ada293dd24ff0bab02491">natsMsgHeader_Keys</a>(msg, &amp;keys, &amp;count);</div>
<div class="line"><span class="keywordflow">if</span> (s == <a class="code hl_enumvalue" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9cee6c417868ecaa69f99ff4f6576990">NATS_OK</a>)</div>
<div class="line">{</div>
<div class="line">     <span class="comment">// do something with the keys</span></div>
<div class="line"> </div>
<div class="line">     <span class="comment">// then free the array of pointers.</span></div>
<div class="line">     free((<span class="keywordtype">void</span>*) keys);</div>
<div class="line">}</div>
<div class="ttc" id="agroup__msg_group_html_ga6ee8a007111ada293dd24ff0bab02491"><div class="ttname"><a href="group__msg_group.html#ga6ee8a007111ada293dd24ff0bab02491">natsMsgHeader_Keys</a></div><div class="ttdeci">NATS_EXTERN natsStatus natsMsgHeader_Keys(natsMsg *msg, const char ***keys, int *count)</div><div class="ttdoc">Get all header keys.</div></div>
</div><!-- fragment --><dl class="section warning"><dt>Warning</dt><dd>Headers are not thread-safe, that is, you must not set/add/get values or delete keys for the same message from different threads. The internal structure of <code>natsMsg</code> may possible be altered during this call.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
    <tr><td class="paramname">keys</td><td>the memory location where the library will store the pointer to the array of keys. </td></tr>
    <tr><td class="paramname">count</td><td>the memory location where the library will store the number of keys returned. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>NATS_NOT_FOUND if no key is present. </dd></dl>

</div>
</div>
<a id="gac78ca02dc93d05cae837ced6386408f1" name="gac78ca02dc93d05cae837ced6386408f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac78ca02dc93d05cae837ced6386408f1">&#9670;&nbsp;</a></span>natsMsgHeader_Delete()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsMsgHeader_Delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section warning"><dt>Warning</dt><dd>Prior to v3.0.0, the <code>key</code> was stored in its canonical form, this is no longer the case. Header keys are now case sensitive.</dd>
<dd>
Headers are not thread-safe, that is, you must not set/add/get values or delete keys for the same message from different threads. The internal structure of <code>natsMsg</code> may possible be altered during this call.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
    <tr><td class="paramname">key</td><td>the key to delete from the headers map. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>NATS_NOT_FOUND if <code>key</code> is not present in the headers. </dd></dl>

</div>
</div>
<a id="ga43aa4a8e4b93725b4876ee2677e19c7b" name="ga43aa4a8e4b93725b4876ee2677e19c7b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga43aa4a8e4b93725b4876ee2677e19c7b">&#9670;&nbsp;</a></span>natsMsg_IsNoResponders()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> bool natsMsg_IsNoResponders </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Starting with the NATS Server v2.2.0+ and the C client v2.2.0+ releases, which introduced support for message headers and the "no responders" feature, if a request is received by the server and there are no subscriptions on the request's subject, the server sends a message with no payload but with a header "Status" with value "503".</p>
<p >The call <a class="el" href="group__conn_pub_group.html#gaf4b4a022f9c21fc269b87c000330c5a7" title="Sends a request and waits for a reply.">natsConnection_Request()</a> and its variants intercept this special message and instead of returning it to the user, they return <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80aab97324e40ccfe1360080c651c330e62" title="No responders were running when the server received the request.">NATS_NO_RESPONDERS</a>.</p>
<p >If a synchronous subscription is created on a subject used as a reply subject to a <a class="el" href="group__conn_pub_group.html#gaaaa3d75ffec2dcdc6bf905cdb1eee59e" title="Publishes data on a subject expecting replies on the given reply.">natsConnection_PublishRequest</a> call (and its variants), <a class="el" href="group__sub_group.html#ga6538a5d78dfb0f16514b94c8e74c11af" title="Returns the next available message.">natsSubscription_NextMsg</a> also detects this message and returns <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80aab97324e40ccfe1360080c651c330e62" title="No responders were running when the server received the request.">NATS_NO_RESPONDERS</a> (but it was not from release v2.2.0 to v2.4.1).</p>
<p >For asynchronous subscriptions, the user may want to know that the request failed because there are no responders. For that reason, the message is passed to the message callback, and this function can be used to detect that this is a "no responders" message from the server and act accordingly.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if this message is a "no responders" message from the server, that is, has no payload and the "Status" header with "503" as the value. </dd></dl>

</div>
</div>
<a id="ga9e9590018284939f43f60964283f33ae" name="ga9e9590018284939f43f60964283f33ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9e9590018284939f43f60964283f33ae">&#9670;&nbsp;</a></span>natsMsg_Destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void natsMsg_Destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Destroys the message, freeing memory.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the pointer to the <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a> object to destroy. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">NATS.IO Supported By Synadia Communications Inc.
    <a href="http://www.nats.io">
    </a></li>
  </ul>
</div>
</body>
</html>
